const TOKEN_KEY = "admin-token";
const LANGUAGE_KEY = "language";

function getToken(): string {
  return localStorage.getItem(TOKEN_KEY) || "";
}

function setToken(token: string) {
  return localStorage.setItem(TOKEN_KEY, token);
}

function clearToken() {
  return localStorage.removeItem(TOKEN_KEY);
}

function getLanguage(): string {
  return localStorage.getItem(LANGUAGE_KEY) || "";
}

function setLanguage(language: string) {
  return localStorage.setItem(LANGUAGE_KEY, language);
}

function clearLanguage() {
  return localStorage.removeItem(LANGUAGE_KEY);
}

export {
  getToken,
  setToken,
  clearToken,
  getLanguage,
  setLanguage,
  clearLanguage,
};
